// router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
import home from '../views/home.vue'
import list from '../views/list.vue'
import detail from '../views/detail.vue'

const routes = [
  {
    path: '/',
    component: home, // 外层布局
    children: [
      {
        path: '',
        name: '文章列表',
        component: list,
      },
      {
        path: 'article/:id',
        name: '文章详情',
        component: detail,
      },
    ],
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
